<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<jsp:include page="top.jsp"></jsp:include>

<script type="text/javascript" language="javascript"> 
	$(function(){ 
		$("#orgRegLocationCode0").unbind("change", eDropLangChange).bind("change", eDropLangChange); 
		$("#orgRegLocationCode").unbind("change", eDropFrameChange).bind("change", eDropFrameChange); 
		
		$("#orgCurrLocationCode0").unbind("change", eDropLangChange2).bind("change", eDropLangChange2); 
		$("#orgCurrLocationCode").unbind("change", eDropFrameChange2).bind("change", eDropFrameChange2); 
	}); 
	var eDropLangChange = function(){ 
		var selectedValue = $(this).val(); 
		$("#orgRegLocationCode").children("span").each(function(){ 
			$(this).children().clone().replaceAll($(this)); 
		}); 

		if(parseInt(selectedValue) != 0){ 
			$("#orgRegLocationCode").children("option[parentid!='" + selectedValue + "'][value!='0']").each(function(){ 
				$(this).wrap("<span style='display:none'></span>"); 
			}); 
		} 
	}; 
	var eDropFrameChange = function(){  
		$("#orgRegLocationCode0").val($(this).children("option:selected").attr("parentid")); 
	}; 
	
	var eDropLangChange2 = function(){ 
		var selectedValue = $(this).val(); 
		$("#orgCurrLocationCode").children("span").each(function(){ 
			$(this).children().clone().replaceAll($(this)); 
		}); 

		if(parseInt(selectedValue) != 0){ 
			$("#orgCurrLocationCode").children("option[parentid!='" + selectedValue + "'][value!='0']").each(function(){ 
				$(this).wrap("<span style='display:none'></span>"); 
			}); 
		} 
	}; 
	var eDropFrameChange2 = function(){  
		$("#orgCurrLocationCode0").val($(this).children("option:selected").attr("parentid")); 
	}; 
	
	
	/*	2014年9月1日21:36:07                          */
	/*=======================================*/
	$(document).ready(function(){
		
	});
	
		function uploadSucced(msg){
	//	var btn = $("#createPeriadBtn");
	//	btn.button('reset');
		$("#firstUploadSucceedMsg").html(msg);
		$("#firstUploadSucceed").show();
		$("#firstUploadFailed").hide();
		var strs = new Array();
		strs = msg.split("&");
		if(strs[1]=="1"){
			document.getElementById("userCertFrontPhotoImg").src=path + strs[0];
			$("#userCertFrontPhotoUrlInput").val(strs[0]);
		}else if(strs[1]=="0"){
			document.getElementById("userCertObversePhotoImg").src=path + strs[0];
			$("#userCertObversePhotoUrlInput").val(strs[0]);
		}else if(strs[1]=="2"){
			document.getElementById("orgBusinessCertPhotoImg").src=path + strs[0];
			$("#orgBusinessCertPhotoUrlInput").val(strs[0]);
		}else if(strs[1]=="3"){
			document.getElementById("orgTaxRegCertPhotoImg").src=path + strs[0];
			$("#orgTaxRegCertPhotoUrlInput").val(strs[0]);
		}
	}
	//表单提交修改失败后，传回提示信息
	function uploadFailed(msg){
	//	var btn = $("#updateperiadBtn");
	//	btn.button('reset');
		$("#firstUploadFailedMsg").html(msg);
		$("#firstUploadFailed").show();
		$("#firstUploadSucceed").hide();
	}
	
	</script> 

<!-- START:wrapper -->
<div id="wrapper">
<!-- InstanceBeginEditable name="wrapper" -->

<!-- START:wrapper-bg -->
<div class="wrapper-bg">

<!-- START:main -->
<div id="main">

<!-- START:gyfrz -->
<div class="gyfrz">

	<!-- START:gyfrz-top -->
	<div class="gyfrz-top">
	
	<!-- START:pankuzu -->
	<div class="pankuzu">
	
	<strong>您所在位置：</strong><a href="index.html">首页</a><img src="shared/images/temp_pankuzu_01.gif" width="5" height="6" alt="img" /><span class="color-green-287">供应方认证</span>
	
	</div>
	<!-- END:pankuzu -->
	
	</div>
	<!-- END:gyfrz-top -->
	
	<!-- START:gyfrz-content -->
	<div class="gyfrz-content">
	<form id="supplyCertifyForm" >
		<!-- START:gyfrz-left -->
		<div class="gyfrz-left">
		
		<h5><span class="text-h5">企业信息录入</span></h5>
		
		<table width="100%" border="0" cellspacing="0" cellpadding="0" class="gyfrz-left-table">
			<tr>
				<th>企业名称：</th>
				<td>
					<input type="text" value="${user.orgName}" name="orgName" id="orgName" class="gyfrz-left-input" />
				</td>
			</tr>
			
			<tr>
				<th>企业法人姓名：</th>
				<td>
					<input type="text" value="${user.orgLawfulManName}" name="orgLawfulManName" id="orgLawfulManName" class="gyfrz-left-input-b" />
				</td>
			</tr>
			
			<tr>
				<th>营业执照注册号：</th>
				<td>
					<input type="text" value="${user.orgBusinessCertPhotoNo}" name="orgBusinessCertPhotoNo" id="orgBusinessCertPhotoNo" class="gyfrz-left-input" />
				</td>
			</tr>
			
			<tr>
			<th>营业执照所在地：</th>
			<td>
			
				<select id="orgRegLocationCode0" name="orgRegLocationCode0" class="zbrz-left-select"> 
							<option value="0" selected="selected">--省份--</option> 
							<c:if test="${!empty locations}">
								<c:forEach var="location" items="${locations}">
									<c:if test="${location.locationCode==location.pLocationCode}">
										<fmt:parseNumber var="prov" integerOnly="true" type="number" value="${(user.orgRegLocationCode/1000)}" />
										<c:if test="${location.locationCode==prov}">
											<option value="${location.locationCode}" selected="selected">${location.locationName}</option>
										</c:if>
										<c:if test="${location.locationCode!=prov}">
											<option value="${location.locationCode}">${location.locationName}</option>
										</c:if>
									</c:if>
								</c:forEach>
							</c:if> 
						</select> 
						<select id="orgRegLocationCode" name="orgRegLocationCode" class="zbrz-left-select"> 
							<option value="0" selected="selected">--城市-- </option>
							<c:if test="${!empty locations}">
								<c:forEach var="location" items="${locations}">
									<c:if test="${location.locationCode!=location.pLocationCode}">
										<c:if test="${location.locationCode==user.orgRegLocationCode }">
											<option value="${location.locationCode}" parentid="${location.pLocationCode}" selected="selected">${location.locationName}</option>
										</c:if>
										<c:if test="${location.locationCode!=user.orgRegLocationCode }">
											<option value="${location.locationCode}" parentid="${location.pLocationCode}" >${location.locationName}</option>
										</c:if>
									</c:if>
								</c:forEach>
							</c:if> 
						</select> 
			</td>
			</tr>
			
			<tr>
				<th>常用地址：</th>
				<td>
					<input type="text" name="orgCurAddr" value="${user.orgCurAddr }" id="orgCurAddr" class="gyfrz-left-input" />
				</td>
			</tr>
			
			<tr>
				<th>联系电话：</th>
				<td>
					<input type="text" name="orgPhoneNo" value="${user.orgPhoneNo }" id="orgPhoneNo" class="gyfrz-left-input" />
				</td>
			</tr>
			
			<!-- <tr>
			<th>营业执照副本扫描件：</th>
			<td><div class="gyfrz-photo-but"><a href="#" class="link-green-a">点击上传</a></div><div class="gyfrz-photo-yl"></div></td>
			</tr>
			
			<tr>
			<th>业税务登记证件扫描件：</th>
			<td><a href="#" class="link-green-a"><strong>点击上传</strong></a></td>
			</tr> -->
			
			
			<tr>
				<th>组织机构代码：</th>
				<td>
					<input type="text" name="orgCode" value="${user.orgCode }" id="orgCode" class="gyfrz-left-input" />
				</td>
			</tr>
			
			
			<tr>
				<th>经营范围：</th>
				<td>
				
				<c:if test="${!empty targets}">
					<c:forEach var="cert" items="${targets}">
						<c:if test="${cert.recordStatusCode=='2'}">
							<input type="checkbox" name="targets" value="${cert.targetCode}" checked="checked"> ${cert.targetName} 
						</c:if>
						<c:if test="${cert.recordStatusCode!=2}">
							<input type="checkbox" name="targets" value="${cert.targetCode}"> ${cert.targetName} 
						</c:if>
					</c:forEach>
				</c:if>
				<!-- <select name="select" id="select" class="zbrz-left-select">
				    <option>经营范围</option>
				</select> -->
				</td>
			</tr>
			
			<tr>
				<th>注册资本：</th>
				<td>
					<input type="text" name="orgRegCapital" value="${user.orgRegCapital }" id="orgRegCapital" class="gyfrz-left-input" />
					
				</td>
			</tr>
			
			<tr>
				<th>备注(选填)：</th>
				<td>
					<textarea name="remark" id="remark" cols="45" rows="5" class="tender-textarea" placeholder="备注">${user.remark}</textarea>
				</td>
			</tr>
			
			<tr>
			<th></th>
			<td></td>
			</tr>
		</table>
	
	</div>
		<!-- END:gyfrz-left -->
		
		<!-- START:gyfrz-right -->
		<div class="gyfrz-right">
		
		<h5><span class="text-h5">申请人信息录入</span></h5>
		
		
		<table width="100%" border="0" cellspacing="0" cellpadding="0" class="gyfrz-left-table">
			<tr>
				<th>申请人姓名：</th>
				<td>
					<input type="text" name="userName" id="userName" value="${user.userName}" class="gyfrz-left-input" />
				</td>
			</tr>
			
			
			<tr>
				<th>当前职位：</th>
				<td>
					<input type="text" name="userCurrPosition" value="${user.userCurrPosition }" id="userCurrPosition" class="zbrz-left-input-b" class="gyfrz-left-input-b" />
				</td>
			</tr>
			
			<tr>
				<th>申请人证件：</th>
				<td>
					<select id="userCertTypeCode" name="userCertTypeCode" class="zbrz-left-select">
						<c:if test="${!empty certs}">
							<c:forEach var="cert" items="${certs}">
								<c:if test="${cert.codeId==user.userCertTypeCode}">
									<option value="${cert.codeId }" selected="selected">${cert.codeDesc}</option>
								</c:if>
								<c:if test="${cert.codeId!=user.userCertTypeCode}">
									<option value="${cert.codeId }">${cert.codeDesc}</option>
								</c:if>
							</c:forEach>
						</c:if>
	                 </select>
				</td>
			</tr>
			
			<tr>
				<th></th>
				<td>
					<input type="text" name="userCertNo" value="${user.userCertNo }" id="userCertNo" class="gyfrz-left-input" />
				</td>
			</tr>
			
			<!-- <tr>
			<th>申请人证件扫描件：</th>
			<td><a href="#" class="link-green-a"><strong>点击上传</strong></a></td>
			</tr> -->
			
			<tr>
				<th>申请人手机号码：</th>
				<td>
					<input type="text" value="${user.userMobile }" name="userMobile" id="userMobile" class="gyfrz-left-input" />
				</td>
			</tr>
			
			<tr>
				<th>申请人邮箱：</th>
				<td>
					<input type="text" name="userEmail" id="userEmail" value="${user.userEmail }" class="gyfrz-left-input" />
				</td>
			</tr>
			
			<tr>
				<th>个人说明(选填)：</th>
				<td>
					<textarea name="userDesc" id="userDesc" value="" cols="45" rows="5" class="tender-textarea" placeholder="必填不少于10个字">${user.userDesc}</textarea>
					<input type="hidden" value="${user.userCertFrontPhotoUrl}" name="userCertFrontPhotoUrl" id="userCertFrontPhotoUrlInput" >    
						<input type="hidden" value="${user.userCertObversePhotoUrl}" name="userCertObversePhotoUrl" id="userCertObversePhotoUrlInput" >    
						<input type="hidden" value="${user.orgBusinessCertPhotoUrl}" name="orgBusinessCertPhotoUrl" id="orgBusinessCertPhotoUrlInput" >    
						<input type="hidden" value="${user.orgTaxRegCertPhotoUrl}" name="orgTaxRegCertPhotoUrl" id="orgTaxRegCertPhotoUrlInput" >    
				</td>
			</tr>
			
			<tr>
			<th></th>
			<td></td>
			</tr>
			
			<tr>
			<th></th>
			<td></td>
			</tr>
		</table>
		
		</div>
		<!-- END:gyfrz-right -->
	
		
	</form>
	
		
	<form id ="firstUpdateForm" action="<%=path%>/user/uploadFile.do?imgType=1" method="post"
	    enctype="multipart/form-data" class="form-horizontal" role="form" target="hidden_frame">
	    <div class="zbrz-info-qiye">
	    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="zbrz-tabel-qiye" >
			<tr>
				<th><span></span>申请人证件正面:</th>
				<td><input type="file" id="firstDemoImgFile" name="imgFile"></td>
			</tr>
			<tr>
				<th><span>&nbsp;</span><button id="createPeriadBtn" type="submit" class="btn btn-default">上传</button></th>
				<td>
					<c:if test="${user.userCertFrontPhotoUrl != null}">
						<img style="width:200px;height:117px;" id="userCertFrontPhotoImg" src="<%=path%>${user.userCertFrontPhotoUrl}" />
					</c:if>
					<c:if test="${user.userCertFrontPhotoUrl == null}">
						<img style="width:200px;height:117px;" id="userCertFrontPhotoImg" src="<%=path%>/img/test.jpg" />
					</c:if>
					</br><div id="errmsg_userCertFrontPhotoUrl" class="errmsg" style="color: #FFFFFF; font-size: 12px; "></div>
				</td>
			</tr>
		</table>
		</div>
	</form> 
	
	
	
	<form id ="firstUpdateForm" action="<%=path%>/user/uploadFile.do?imgType=2" method="post"
	    enctype="multipart/form-data" class="form-horizontal" role="form" target="hidden_frame">
	    <div class="zbrz-info-qiye">
	     <table width="100%" border="0" cellspacing="0" cellpadding="0" class="zbrz-tabel-qiye" >
			<tr>
				<th><span></span> 营业执照证件上传:</th>
				<td><input type="file" id="firstDemoImgFile" name="imgFile"></td>
			</tr>
			<tr>
				<th><span>&nbsp;</span><button id="createPeriadBtn" type="submit" class="btn btn-default">上传</button></th>
				<td>
					<c:if test="${user.orgBusinessCertPhotoUrl != null}">
						<img style="width:200px;height:117px;" id="orgBusinessCertPhotoImg"src="<%=path%>${user.orgBusinessCertPhotoUrl}" />
					</c:if>
					<c:if test="${user.orgBusinessCertPhotoUrl == null}">
						<img style="width:200px;height:117px;" id="orgBusinessCertPhotoImg"src="<%=path%>/img/test.jpg" />
					</c:if>
					</br><div id="errmsg_orgBusinessCertPhotoUrl" class="errmsg" style="color: #FFFFFF; font-size: 12px; "></div>
				</td>
			</tr>
		</table>
		</div>
	</form> 
	
	<form id ="firstUpdateForm" action="<%=path%>/user/uploadFile.do?imgType=0" method="post"
	    enctype="multipart/form-data" class="form-horizontal" role="form" target="hidden_frame">
	    <div class="zbrz-info-qiye">
	     <table width="100%" border="0" cellspacing="0" cellpadding="0" class="zbrz-tabel-qiye" >
			<tr>
				<th><span></span>申请人证件反面:</th>
				<td><input type="file" id="firstDemoImgFile" name="imgFile"></td>
			</tr>
			<tr>
				<th><span>&nbsp;</span><button id="createPeriadBtn" type="submit" class="btn btn-default">上传</button></th>
				<td>
					<c:if test="${user.userCertObversePhotoUrl != null}">
						<img style="width:200px;height:117px;" id="userCertObversePhotoImg"src="<%=path%>${user.userCertObversePhotoUrl}" />
					</c:if>
					<c:if test="${user.userCertObversePhotoUrl == null}">
						<img style="width:200px;height:117px;" id="userCertObversePhotoImg"src="<%=path%>/img/test.jpg" />
					</c:if>
					</br><div id="errmsg_userCertObversePhotoUrl" class="errmsg" style="color: #FFFFFF; font-size: 12px; "></div>
				</td>
			</tr>
		</table>
		</div>
	</form> 
	
	<form id ="firstUpdateForm" action="<%=path%>/user/uploadFile.do?imgType=3" method="post"
	    enctype="multipart/form-data" class="form-horizontal" role="form" target="hidden_frame">
	    <div class="zbrz-info-qiye">
	     <table width="100%" border="0" cellspacing="0" cellpadding="0" class="zbrz-tabel-qiye" >
			<tr>
				<th><span></span> 税务登记证件上传:</th>
				<td><input type="file" id="firstDemoImgFile" name="imgFile"></td>
			</tr>
			<tr>
				<th><span>&nbsp;</span><button id="createPeriadBtn" type="submit" class="btn btn-default">上传</button></th>
				<td>
					<c:if test="${user.orgTaxRegCertPhotoUrl != null}">
						<img style="width:200px;height:117px;" id="orgTaxRegCertPhotoImg"src="<%=path%>${user.orgTaxRegCertPhotoUrl}" />
					</c:if>
					<c:if test="${user.orgTaxRegCertPhotoUrl == null}">
						<img style="width:200px;height:117px;" id="orgTaxRegCertPhotoImg"src="<%=path%>/img/test.jpg" />
					</c:if>
					</br><div id="errmsg_orgTaxRegCertPhotoUrl" class="errmsg" style="color: #FFFFFF; font-size: 12px; "></div>
				</td>
			</tr>
		</table>
		</div>
	</form> 
	
	<div id="firstUploadSucceed" style="display: none;">
	    <strong>文件上传成功！</strong><span id="firstUploadSucceedMsg"></span>
	</div>
	<div id="firstUploadFailed" style="display: none;">
	    <strong>对不起！文件上传失败！</strong><span id="firstUploadFailedMsg"></span>
	</div>
	<iframe name='hidden_frame' id="hidden_frame" style='display:none'></iframe>
	
	
	
	<br class="clear" />
		<div class="submit">
			<a href="javascript:supplyCertify();">
				<img src="shared/images/button_zbrz_ok.gif" width="143" height="53" alt="button" />
			</a>
		</div>
	
	
	
</div>
<!-- END:gyfrz-content -->


</div>
<!-- END:gyfrz -->

</div>
<!-- END:main -->

</div>
<!-- END:wrapper-bg -->

<!-- InstanceEndEditable -->
</div>
<!-- END:wrapper -->

<jsp:include page="bottom.jsp"></jsp:include>